2020 will probably be remembered as the “Year of COVID”, as that initial year of the pandemic marked extremely high rates of infected individuals, as seen in Figure 1, where the rate increases rapidly from day 200 t about day 400. The interactive plot represents confirmed cases of COVID-19 in Colorado from March 2, 2020 to March 2, 2021. The plot is a geom_hex object, hence the hexagons, each representing approximately 14-day periods (365 days in 25 bins is 14.6 days).
p <- ggplotly(data=covid_co, x = ~numb, y = ~conf_cases, type = "scatter")
p
{% if page.htmlwidgets %} {% for html_dep in site.static_files %} {% if html_dep.path contains 'htmlwidgets_deps/' %} {% assign start = "" }} {% endif %} {% endfor %} {% endif %}
library(htmlwidgets)
saveWidget(p, "p1.html", selfcontained = F, libdir = "covid_files")
widget_file_size <- function(p) {
  d <- tempdir()
  withr::with_dir(d, htmlwidgets::saveWidget(p, "index.html"))
  f <- file.path(d, "index.html")
  mb <- round(file.info(f)$size / 1e6, 3)
  message("File is: ", mb," MB")
}
widget_file_size(p)